package com.example.demo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;

public class UserPermission {
    // 当前用户 Id，当 update=1；print=1时必须返回当前用户的 user_id
    @JsonProperty("user_id")
    private String userId;

    // 是否具有预览权限，0-无 1-有
    @JsonProperty("read")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private boolean read;

    // 是否具有编辑权限，0-无 1-有
    @JsonProperty("update")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private boolean update;

    // 是否具有下载文档权限，0-无 1-有
    @JsonProperty("download")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private boolean download;

    // 是否具有重命名文档权限，0-无 1-有
    @JsonProperty("rename")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private boolean rename;

    // 是否具有查看文档历史记录权限，0-无 1-有
    @JsonProperty("history")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private boolean history;

    // 是否具有拷贝文档内容权限，0-无 1-有
    @JsonProperty("copy")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private boolean copy;

    // 是否具有打印文档权限，0-无 1-有
    @JsonProperty("print")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private boolean print;

    // 是否具有另存当前文档权限，0-无 1-有。该属性现阶段暂无相关入口，开发者可不用关注
    @JsonProperty("saveas")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private boolean saveAs;

    // 是否具有评论文档权限，0-无 1-有
    @JsonProperty("comment")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_INT)
    private boolean comment;

    // Setters
    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setRead(boolean read) {
        this.read = read;
    }

    public void setUpdate(boolean update) {
        this.update = update;
    }

    public void setDownload(boolean download) {
        this.download = download;
    }

    public void setRename(boolean rename) {
        this.rename = rename;
    }

    public void setHistory(boolean history) {
        this.history = history;
    }

    public void setCopy(boolean copy) {
        this.copy = copy;
    }

    public void setPrint(boolean print) {
        this.print = print;
    }

    public void setSaveAs(boolean saveAs) {
        this.saveAs = saveAs;
    }

    public void setComment(boolean comment) {
        this.comment = comment;
    }
}